package com.starlink.model.util;

import com.starlink.model.dtomapper.MallPeripherySpecificationDtoMapper;
import com.starlink.model.domain.MallPeripherySpecificationDO;
import com.starlink.model.vo.MallPeripherySpecificationVO;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhanghong
 */
public class MallPeripherySpecificationConvert {

    public static List<MallPeripherySpecificationVO> buildMallPeripherySpecificationVoList(List<MallPeripherySpecificationDO> mallPeripherySpecificationDOList) {
        if (CollectionUtils.isEmpty(mallPeripherySpecificationDOList)) {
            return Lists.newArrayList();
        }
        List<MallPeripherySpecificationVO> mallPeripherySpecificationVOList = new ArrayList<>();
        for (MallPeripherySpecificationDO mallPeripherySpecificationDO : mallPeripherySpecificationDOList) {
            mallPeripherySpecificationVOList.add(MallPeripherySpecificationDtoMapper.INSTANCE.do2VO(mallPeripherySpecificationDO));
        }

        return mallPeripherySpecificationVOList;
    }
}
